<template>
  <div class="video-info">
    <div class="up">
      <div class="launch-app-btn">
        <a href="#">
          <img :src="face" class="avatar" />
        </a>
        <div class="info">
          <a href="" class="name">{{ name }}</a>
          <p class="fans">{{ fans }}粉丝</p>
        </div>
      </div>
      <van-button size="mini" color="#fff" plain>+ 关注</van-button>
    </div>
    <div class="title">{{ title }}</div>
    <div class="author-info">
      <span class="toolbar-item">
        <van-icon name="fire" />
        <span>{{ view }}</span>
      </span>

      <span class="toolbar-item">
        <i class="iconfont dianzan"></i>
        <span>{{ favorite }}</span>
      </span>
      <span class="toolbar-item">
        <i class="iconfont icon_fav"></i>
        <span>{{ like }}</span>
      </span>
      <span class="toolbar-item">
        <van-icon name="share" />
        <span>分享</span>
      </span>
      <span class="toolbar-item">
        <van-icon name="gem" />
        <span>缓存</span>
      </span>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { storeToRefs } from "pinia";
import { useVideoPlayStore } from "@/stores/videoplay";
import { watch } from "vue";
const store = useVideoPlayStore();

const { archiveslist, Bloggerres } = storeToRefs(store);
const { title, pic } = archiveslist.value;
const { like, view, favorite } = archiveslist.value.stat;
const { name } = archiveslist.value.owner;
const { face, fans } = Bloggerres.value.Card.card;
</script>

<style lang="less" scoped>
:deep(.van-icon) {
  font-size: 6.86667vmin;
  color: #61666d;
}
.toolbar-item {
  margin: 0 2vw;
  display: flex;
  align-items: center;
  flex: 1;
  flex-direction: column;
  text-align: center;
}
:deep(.van-button--mini) {
  display: inline-block;
  text-align: center;
  width: 17.6vmin;
  height: 6.4vmin;
  color: #fff;
  border-radius: 1.06667vmin;
  line-height: 6.4vmin;
  font-size: 3.46667vmin;
  background: #fb7299;
}
.video-info {
  padding: 3vw 2vw;
  border-bottom: 1px solid #ddd;

  .up {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .launch-app-btn {
      display: flex;
      align-items: center;
      img {
        width: 10.73333vmin;
        height: 10.73333vmin;
        border-radius: 50%;
        border: 0.5px solid #9499a0;
      }
      .info {
        position: relative;
        top: -0.46667vmin;
        margin-left: 2vw;
        .name {
          font-size: 3.73333vmin;
          color: #18191c;
          display: block;
          height: 4.53333vmin;
          line-height: 4.53333vmin;
        }
        .fans {
          margin-top: 1.33333vmin;
          font-size: 3.2vmin;
          height: 3.2vmin;
          line-height: 3.2vmin;
          color: #9499a0;
        }
      }
      .author-info {
        display: inline-block;
        position: relative;

        .facer {
          display: flex;
          .avatar {
            position: relative;
            vertical-align: middle;
            margin-right: 2.66667vmin;
          }
        }
      }
    }
  }

  .title {
    font-size: 4vw;
    line-height: 6vw;
    margin: 2vw 0 2vw 2vw;
  }
  .author-info {
    display: flex;
    align-items: center;
    font-size: 3vw;
    color: #999;
    .author {
      flex: 1;
      .author-avatar {
        width: 9.6vmin;
        height: 9.6vmin;
        object-fit: cover;
        border-radius: 50%;
        overflow: hidden;
        margin: 0 1vw;
        background: url(@/assets/images/loading.png) no-repeat center #e7e7e7;
      }

      .author-name {
        color: #212121;
      }
    }
    > span {
      margin: 0 2vw;
    }
    .iconfont {
      font-size: 5vw;
      color: #757575;
      margin-right: 1vw;
      font-size: 7vw;
    }
  }
}
</style>
